/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sessionbean;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import supportlearning.entities.Account;

/**
 *
 * @author Huy
 */
@Stateless
public class deleteuser implements deleteuserLocal {

    @PersistenceContext(unitName = "EprojectCMSSupportLearning-ejbPU")
    private EntityManager em;

    public boolean deleteuser(String id) {
        Account acc = em.find(Account.class, id);
        if (acc == null) {
            return false;
        } else {
            em.remove(acc);
            return true;
        }

    }

    public void persist(Object object) {
        em.persist(object);
    }
}
